<template>
  <div>
    <h1>房间管理</h1>
    姓名：<input type="text" v-model="param.name"><br>
    头像：<input type="file" @change="getFile($event)"><br>
    <input type="button" value="提交" @click="formSubmit">
  </div>
</template>

<script>
export default {
  data(){
    return{
      param:{}
    }
  },
  methods:{
    getFile(event){
      //得到文件表单的dom对象
      this.param.face = event.target.files[0];
      event.preventDefault();
    },
    async formSubmit(){
      var info = await this.ajax.uploadSubmit("/project/upload/add",this.param);
      if(info == "ok"){
        alert(info);
      }
    }
  }
}
</script>

<style>

</style>